from django import forms


class BootStrapModelForm(forms.ModelForm):
    def __init__(self,*args,**kwargs):
        # 继承父类
        super().__init__(*args,**kwargs)
        # 循环出所有字段,统一给ModelForm字段加样式
        for name,field in self.fields.items():
            field.widget.attrs['class'] = 'form-control'